//
//  FaceView.m
//  绘制脸
//
//  Created by 胡先剑 on 16/4/6.
//  Copyright © 2016年 胡先剑. All rights reserved.
//

#import "FaceView.h"

@implementation FaceView



- (void)drawRect:(CGRect)rect
{
    UIBezierPath *path1 = [UIBezierPath  bezierPath];
    [path1 addArcWithCenter:CGPointMake(160, 230) radius:140 startAngle:0 endAngle:M_PI*2 clockwise:YES];
    [[UIColor redColor] setStroke];
    path1.lineWidth = 3;
    [path1 stroke];
    
    UIBezierPath *path2 = [UIBezierPath  bezierPath];
    [path2 addArcWithCenter:CGPointMake(80, 200) radius:10 startAngle:0 endAngle:M_PI*2 clockwise:YES];
    [[UIColor redColor] set];
    [path2 fill];
    
    UIBezierPath *path3 = [UIBezierPath  bezierPath];
    [path3 addArcWithCenter:CGPointMake(240, 200) radius:10 startAngle:0 endAngle:M_PI*2 clockwise:YES];
    [[UIColor redColor] set];
    [path3 fill];
    
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGContextMoveToPoint(ctx, 100, 280);
    CGContextAddQuadCurveToPoint(ctx, self.x, self.y, 220, 280);
    [[UIColor redColor] setStroke];
    CGContextSetLineWidth(ctx, 2);
    CGContextStrokePath(ctx);
}


@end
